/**
 * Created by win7 on 2017/3/18.
 */


import React from "react";

import { hashHistory } from 'react-router';

/*导出组件*/
export default class People_item extends React.Component {
    constructor(props) {
        super(props)
        this.state={
            context:[]
        }
        this.name=[]
    }

    componentWillMount() {
        this.setState({
            context:this.props.item
        })
    }

    edit(){
        hashHistory.push('/editrole')
        this.props.edit();
    }
    deletz(rid){
        this.props.deletz(rid);
    }
    editpeople(){
        this.props.edit()
    }
    render() {
        return (
            <li className="limit_duty_tb" >
                <span className="limit_duty_nor limit_duty_t1">{this.state.context.roleId}</span>
                <span className="limit_duty_nor limit_duty_t2">{this.state.context.name}</span>
                <span className="limit_duty_nor limit_duty_t3">{this.state.context.phone}</span>
                <span className="limit_duty_nor limit_duty_t4">{this.state.context.role}</span>
                <span className="limit_duty_nor limit_duty_t5">{this.state.context.status}</span>
                <div className="limit_duty_nor limit_duty_t6">
                    <i className="operate" onClick={this.editpeople.bind(this)}>编辑</i>
                    <i className="operate">禁用</i>
                    <i onClick={this.deletz.bind(this,this.state.context.rid)} className="operate">删除</i>
                </div>
            </li>
        )

    }
}
